<?php 
namespace app\lib\exception;

use think\exception\Handle;
use Exception;
use InvalidArgumentException;
use think\Db;

class ApiException extends Handle {

    // public function render(Exception $e){ // 重写render方法
    //     try {
    //         $content = json_encode(request()->param())."，系统错误，错误内容：".$e->getMessage();
    //         writeLog('error',$content);
        

    //         $user_ordernum = input('orderNumber');
    //         $account = input('account');
    //         if (!empty($user_ordernum) && !empty($account)) {
    //             $user_id = Db::name('user')->where('account',$account)->value('id');
    //             $order_number = Db::name('order')->where([
    //                 ['user_id','=',$user_id],
    //                 ['user_ordernum','=',$user_ordernum]
    //             ])->value('order_number');
    //             if (!empty($order_number)) {
    //                 $result = ['code'=>2000,'msg'=>'提交成功','order_number'=>$order_number];
    //                 return json($result);
    //             }
    //         }
    //     } catch (\Exception $e) { }

    //     return json(['code'=>5000,'msg'=>'系统错误']);
    // }

}
